﻿using System;
namespace ORS.OrderRobot
{
    /// <summary>
    /// 监控任务
    /// </summary>
    public class MointerTaskConfig
    {
        /// <summary>
        /// 每隔多久执行一次
        /// </summary>
        public int Interval { get; set; } = 60;
        /// <summary>
        /// 间隔单位(默认为秒)
        /// </summary>
        public TimeUnit IntervalUnit { get;set;} = TimeUnit.Second;
        /// <summary>
        /// 开始时间（只支持整点）
        /// </summary>
        public TimeOnly? StartTime { get; set; }
        /// <summary>
        /// 结束时间(只支持整点)
        /// </summary>
        public TimeOnly? EndTime { get; set; }
        /// <summary>
        /// 是否已禁用
        /// </summary>
        public bool Disabled { get; set; } = false;
    }
    /// <summary>
    /// 商品专用任务
    /// </summary>
    public class ProductMointerTaskConfig: MointerTaskConfig
    {
        /// <summary>
        /// 如果商品存在，是否自动下单，默认为false
        /// </summary>
        public bool AutoShopping { get; set; } = false;
    }
    /// <summary>
    /// 自动下单专用任务
    /// </summary>
    public class AutoShoppingTaskConfig : MointerTaskConfig
    {
        /// <summary>
        /// 重试次数,默认3次
        /// </summary>
        public int Retry { get; set; } = 3;
        /// <summary>
        /// 是否采用正常下单流程
        /// </summary>
        public bool IsNormalFlow { get; set; } = false;
    }
}

